home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
adoc2140.zip
/
C.TX_
/
C.TX
Wrap
Text File
|
1994-07-31
|
3KB
|
70 lines
In this example, you should note how the parameter list is handled in
RegexAdd(). Note that for 1-word parameter types, the parameter name
and type can be on the same line. In this case, the description of the
parameter may also be on the same line. For multi-word types (such as
unsigned short or char *), the type must appear on the line AFTER
the parameter name.
In my code, I use *_EXTFNCT for functions/methods callable from outside
a 'module', *_INTFNCT for functions/methods callable from any place
within a 'module' and *_PRVFNCT for functions/methods that can only be
called within a class/file.
// @CHAPTER:REGEX_EXTFNCT
// @FUNCTION RegexAdd
// @SYNTAX int RegexAdd( Context, pMatch, pReplace, errContext )
// @DESCRIPTION This function compiles the match regular expression and, if
// successful, adds a new element to the context.
// @PARAM Context REGEXCONTEXT
// An initialized regular expression context into which the
// new element is to be added.
// @PARAM pMatch
// char *
// Address of NULL-terminated string defining the match
// regular expression.
// @PARAM pReplace
// char *
// Address of NULL-terminated string defining the replace
// regular expression.
// @PARAM errContext ERRORCONTEXT Error stack context
// into which error information is placed.
// @RETURNS 0 if successful otherwise an error code as defined in
// regex.h
// @INCLUDES include/regex.h
// @FILE regex/funcs.c
// @END
The following example shows how you can document C type declarations.
// @CHAPTER:DATA
// @STRUCTURE RECT
// @DESCRIPTION This structure is from the Windows SDK and is used to
// specify a rectangular region in a 2-dimensional space.
// @DEFINITION typedef struct tagRECT
// {
// \ int left;
// \ int top;
// \ int right;
// \ int bottom;
// } RECT;
// @MEMBERDATA left int Coordinate of left of rectangle.
// @MEMBERDATA top int Coordinate of top of rectangle.
// @MEMBERDATA right int Coordinate of right of rectangle.
// @MEMBERDATA bottom int Coordinate of bottom of rectangle.
// @INCLUDES windows.h
// @END
This example shows that C #defines can be documented in a manner that is very
similar to the data type documentation.
// @CHAPTER:DATA
// @MACRO HIWORD
// @DEFINITION #define HIWORD(l)
// ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
// @DESCRIPTION This macro returns bits 15 through 31 of the given
// 4-byte value as a 2-byte value.
// @INCLUDE windows.h
// @END